#ifndef _LT_MAP_FACTORY_H_
#define _LT_MAP_FACTORY_H_

#include <map>
#include "ltSingleton.h"
#include "ltMapState.h"

namespace Lotus
{
	class MapState;
	class Game;

	class LOTUS_API MapFactoryBase:Utilities::Singleton<MapFactoryBase>
	{
	public:		
		virtual ~MapFactoryBase();
		LT_DECLARE_SINGLETON(MapFactoryBase);

		MapState* createMapFromFile(const char* file);
		MapState* createBlankMap(const char* sceneType);
		void saveMapToFile(MapState* map,const char* file);

	protected:
		MapFactoryBase();

	private:
		virtual MapState* newMap()=0;
		std::map<Ogre::String,Ogre::SceneType> sceneManagerDictionary;
	};

	template<typename T=MapState>
	class MapFactory : public MapFactoryBase
	{
	public:
		MapFactory(){}
	private:
		virtual MapState* newMap()
		{
			return new T;
		}
	};
}

#endif